<?php
namespace Admin\Model;
use Think\Model;
class GoodsModel extends Model {
    //自动验证
    protected $_validate = array(
         array('go_id','require','必须！',self::EXISTS_VALIDATE ),
         array('go_no','require','商品编号必须！',self::EXISTS_VALIDATE ),
         array('go_name','require','商品名称必须！',self::EXISTS_VALIDATE ),
         array('go_value','require','商品价格必须！',self::EXISTS_VALIDATE ),
         array('go_brand','require','品牌必须！',self::EXISTS_VALIDATE ),
         array('go_num','require','商品数量必须！',self::EXISTS_VALIDATE ),
         array('go_info','require','介绍必须！',self::EXISTS_VALIDATE ),
         array('classl_id','require','大类必须！',self::EXISTS_VALIDATE ),
         array('classm_id','require','中类必须！',self::EXISTS_VALIDATE ),
         array('classs_id','require','小类必须！',self::EXISTS_VALIDATE ),
         array('go_specifications','require','规格参数必须！',self::EXISTS_VALIDATE ),
         array('go_createtime','require','录入时间必须！',self::EXISTS_VALIDATE ),
         array('go_pics[]','require','缩略图必须！',self::EXISTS_VALIDATE ),
         array('go_status','require','0为上架必须！',self::EXISTS_VALIDATE ),
         array('go_updatetime','require','更新时间必须！',self::EXISTS_VALIDATE ),
         
    );
    // 自动填充设置
    protected $_auto = array(
         array('go_createtime','time',self:: MODEL_INSERT,'function'),
         array('go_updatetime','time',self:: MODEL_INSERT,'function'),
         array('go_updatetime','time',self:: MODEL_UPDATE,'function'),
         array('user_id','getUid',self:: MODEL_INSERT,'function'),
         array('user_id','getUid',self:: MODEL_UPDATE,'function'),

         
    );
}